package pl.perseus.action;

import java.util.HashMap;
import java.util.Map;

import lombok.Getter;
import lombok.Setter;

import org.springframework.beans.factory.annotation.Autowired;

import pl.perseus.model.User;
import pl.perseus.service.user.IUserService;

public class GetCurrentUserAction extends BaseAction {

	@Getter
	@Setter
	Map<String, Object> result;
	
	@Autowired
	IUserService userService;
	

	@Override
	public String execute() {

		result = new HashMap<String, Object>();
		User u = userService.selectUserByLogin(getCurrentUserLogin());
		u.setPassword(null);
		result.put("user", u);
		return SUCCESS;
	}

}
